package com.itheima.test2;

public class StringDemo5 {
    public static void main(String[] args) {
        //手机号 隐藏中间四位
        String phoneNumber = "13145679874";

        //通过 substring() 截取前3位和后4位
        String start = phoneNumber.substring(0,3);

        String end = phoneNumber.substring(7);

        String result = start + "****" + end;

        System.out.println(result);

    }
}
